﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace WGM_Silverlight.Controls
{
    public partial class NetworkInfo : UserControl
    {
        public NetworkInfo()
        {
            InitializeComponent();
            _enterNetworkBtn.Tag = this;
            _networkPasswordTb.Tag = this;
        }
        public string NetworkName
        {
            get { return _networkNameTb.Text; }
            set { _networkNameTb.Text = value; }
        }
        public string NetworkDescription
        {
            get { return _networkDescTb.Text; }
            set { _networkDescTb.Text = value; }
        }
        public string NetworkCreator
        {
            get { return _networkCreatorTb.Text; }
            set { _networkCreatorTb.Text = value; }
        }
        public int NetworkMemberCount
        {
            get { return Convert.ToInt32( _networkMemberCountTb.Text); }
            set { _networkMemberCountTb.Text = value.ToString(); }
        }
        public Visibility NetworkPasswordPromptVisibility
        {
            get { return _networkPasswordPromtTb.Visibility; }
            set { _networkPasswordPromtTb.Visibility = value; }
        }
        public Visibility NetworkPasswordVisibility
        {
            get { return _networkPasswordTb.Visibility; }
            set { _networkPasswordTb.Visibility = value; }
        }
        public string NetworkPassword
        {
            get { return _networkPasswordTb.Password; }
            set { _networkPasswordTb.Password = value; }
        }
        public string NetworkStatusMessage
        {
            get { return _networkStatusMessageTb.Text; }
            set { _networkStatusMessageTb.Text = value; }
        }
        public event MouseButtonEventHandler EnterNetworkClick
        {
            add
            {
                _enterNetworkBtn.MouseLeftButtonDown += value;
            }
            remove
            {
                _enterNetworkBtn.MouseLeftButtonDown -= value;
            }
        }
        public event KeyEventHandler PasswordKeyUp
        {
            add
            {
                _networkPasswordTb.KeyUp += value;
            }
            remove
            {
                _networkPasswordTb.KeyUp -= value;
            }
        }
        public Color NetworkColour
        {
            get { return _networkColour.Color; }
            set { _networkColour.Color = value; }
        }
    }
}
